﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using JMY_IDAL;
using JMY_Models;
using System.Data.SqlClient;
using System.Data;
using Newtonsoft.Json;
namespace JMY_DAL
{
    public class MainShowDAL : JMY_IDAL.MainShow
    {
        SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=HospitalMessage;User ID=sa;password=19961218;");
        public List<T_Doctor_Combo_Model> GetComboInfo()
        {
            string sql = "select * from T_Doctor_Combo";
            SqlDataAdapter da = new SqlDataAdapter(sql, conn);
            DataTable dt = new DataTable();
            da.Fill(dt);
            var data = JsonConvert.DeserializeObject<List<T_Doctor_Combo_Model>>(JsonConvert.SerializeObject(dt));
            return data;
        }
    }
}
